import { http } from "@/utils/http";
import {CtaInfoType} from "./cta.ts";
import {ListResult} from "./models.ts";
import {logRecordType} from "./logRecord.ts";

export interface contentInfoType {
  uuid: string;
  name: string;
  type: string;
  thumb: string;
  material_uuid: string;
  subject?: string[];
  content: string;
  created_at:string
  download: {
    button_name:string

    type:string

    image_thumb: string
    image_material_uuid: string

    file_thumb: string
    file_material_uuid: string
    file_name: string
    file_pre_size: string
    file_size: string

    link_url:string
    link_content:string

    cta_info:CtaInfoType
  }
}


export const contentInfo = (uuid: string) => {
  return http.request<ListResult<contentInfoType>>("get", `/api/open/resource/content/info/${uuid}`);
}



export const logRecord = (data: object) => {
  return http.request<ListResult<logRecordType>>("post", '/api/open/resource/content/log',{
    data
  });
}